<template>
  <div class="home-layout">
    <div class="nav">
      <div class="head">
        <div class="location">
          <i class="icon-head"></i>
          <span class="city">{{homeConfig.city}}</span>
        </div>
        <input type="search" class="query-inp" placeholder="请输入你想查询的线路名" @focus="toSearch">
      </div>
      <nav class="menu">
        <router-link :to="item.href" v-for="(item,index) in homeConfig.link" :key="index"><span>{{item.name}}</span></router-link>
      </nav>
    </div>
    <router-view/>
  </div>
</template>
<script>
  export default {
    computed: {
      homeConfig() {
        return global.lineConfig.home
      }
    },
    methods: {
      toSearch() {
        this.$router.push({path: 'lineQuery'})
      }
    }
  }
</script>
<style scoped>
  @import "../assets/css/home.css";
</style>
